<?php

namespace Condistelec\MainBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\CallbackValidator;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormInterface;

use Doctrine\ORM\EntityRepository;

class UsuarioType extends AbstractType {
	
	public function buildForm(FormBuilder $builder, array $options) {
		$builder->add('nombre');
		$builder->add('apellido');
		$builder->add('email', 'email', array('label' => 'E-Mail'));
	}

	public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Msc\MainBundle\Entity\Usuario',
        	'cascade_validation' => true,
        ));
    }

    public function getName()
    {
        return 'usuario';
    }
}